Skip to content

Support custom mapping files in X12Reader - #81

Open
AbhinavMir wants to merge 1 commit into
imsweb:masterfrom
AbhinavMir:feature-custom-mapping-files
Open

AbhinavMir wants to merge 1 commit into
imsweb:masterfrom
AbhinavMir:feature-custom-mapping-files

Conversation

@AbhinavMir

@AbhinavMir AbhinavMir commented Jun 16, 2026 •

Copy link
Copy Markdown

No description provided.

X12Reader was limited to the standards enumerated in FileType. Add an
X12Mapping interface (transaction definition + expected ANSI version) so
callers can parse files against a mapping that is not built in.

- FileType now implements X12Mapping.
- CustomX12Mapping builds an X12Mapping from a user-supplied mapping XML
  stream and version string, reusing the same secured XStream loader.
- X12Reader gains constructors accepting any X12Mapping (File, InputStream,
  Reader, with optional Charset); the existing FileType constructors
  delegate to them, so the public API is unchanged.

Adds tests parsing a file through a custom mapping and verifying the result
matches the built-in FileType, plus a version-mismatch rejection test. README
documents the new usage.
@ctmay4
ctmay4 requested a review from angelaszek June 17, 2026 12:09
@ctmay4

ctmay4 commented Jun 17, 2026

Copy link
Copy Markdown
Member

@angelaszek can you please take a look?

@ctmay4

ctmay4 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Please fix merge conflicts.

@angelaszek

angelaszek commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

This looks ok to me once the merge conflicts are resolved. It will make the library more flexible if the pre-defined mappings don't work for a particular purpose but shouldn't affect how the library is used in existing code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants